//
//  DRHomeDataModel.m
//  DoctorRen
//
//  Created by Lemon on 2018/11/20.
//

#import "DRHomeDataModel.h"

@implementation DRHomeDataModel

+(void)loadHomeData:(DRHttpModel *)request andSuccess:(void (^)(DRHomeModel *))succBlock andFail:(RequestFail)failBlock{
    [request startRequestSuccess:^(id data) {
        
        if (succBlock) {
            DRHomeModel *model = [DRHomeModel yy_modelWithJSON:data];
            succBlock(model);
        }
    } andFail:failBlock];
}

+(void)loadMessage:(DRHttpModel *)request andSuccess:(void (^)(NSArray <DRMessageModel *>*))succBlock andFail :(RequestFail)failBlock{
    
    [request startRequestSuccess:^(id data) {
        if (succBlock) {
            NSArray *models = [NSArray yy_modelArrayWithClass:[DRMessageModel class] json:data[@"datas"]];
            succBlock(models);
        }
        
    } andFail:failBlock];
}

@end
